﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using EZCRS.HCMS.Bll.baseinfo;
using EZCRS.HCMS.Bll;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.Web;

namespace EZCRS.HCMS.Web.manage.baseinfo
{
    public partial class serviceadd :ManageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                List<HCRS_Facilityclass> _list = new BllFacility().getfclass();

                fclass.DataSource = _list;
                fclass.DataTextField = "classname";
                fclass.DataValueField = "Id";
                fclass.DataBind();
            }
        }

        protected void btnsave_Click(object sender, EventArgs e)
        {
            HCRS_Facility _f = new HCRS_Facility();
            _f.fname = fname.Text.Trim();
            _f.fclass = Convert.ToInt32(fclass.SelectedValue);
            _f.languagetype = LanguageId;

            if(new BllFacility().insertorupdate(_f))
                Page.ClientScript.RegisterClientScriptBlock(typeof(String), "scuress", CFun.AlertMeg(Resources.Site.SystemModifySuccess, "", "serviceadd.aspx"));
            else
                Response.Write(CFun.AlertMeg(Resources.Site.SystemError, "back", ""));
        }
    }
}
